//
//  BodyView.m
//  SHHCPhone
//
//  Created by gfsh on 14-6-20.
//  Copyright (c) 2014年 sheng long. All rights reserved.
//

#import "BodyView.h"

@implementation BodyView
{
    UIScrollView *mainScroll;
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        mainScroll = [[UIScrollView alloc] initWithFrame:self.bounds];
        [mainScroll setBackgroundColor:[UIColor clearColor]];
        [self addSubview:mainScroll];
        [mainScroll setShowsHorizontalScrollIndicator:NO];
        [mainScroll setShowsVerticalScrollIndicator:NO];
        
        
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake(11.5, 17.5, 2, 55*5)];
        line.backgroundColor = GET_COLOR(@"f6f6f6");
        [mainScroll addSubview:line];
        
        _tizhong = [[BodyCell alloc]initWithFrame:CGRectMake(0, 0, 283, 35)];
        _tizhong.icon = [UIImage imageNamed:@"体成分-体重icon"];
        _tizhong.content = @"体重  48.1KG";
        _tizhong.levelIcon = [UIImage imageNamed:@"体成分-超标icon"];
        _tizhong.levelStr = @"超标";
        [mainScroll addSubview:_tizhong];
        [_tizhong loadContent];
        
        _zhifang = [[BodyCell alloc]initWithFrame:CGRectMake(0, _tizhong.frame.origin.y+_tizhong.frame.size.height+13, 283, 35)];
        _zhifang.icon = [UIImage imageNamed:@"体成分-体脂率icon"];
        _zhifang.content = @"体脂率  10%";
        _zhifang.levelIcon = [UIImage imageNamed:@"体成分-超标icon"];
        _zhifang.levelStr = @"偏高";
        [mainScroll addSubview:_zhifang];
        [_zhifang loadContent];
        
        _jirou = [[BodyCell alloc]initWithFrame:CGRectMake(0, _zhifang.frame.origin.y+_zhifang.frame.size.height+13, 283, 35)];
        _jirou.icon = [UIImage imageNamed:@"体成分-肌肉率icon"];
        _jirou.content = @"肌肉率  12.4%";
        _jirou.levelIcon = [UIImage imageNamed:@"体成分-偏低icon"];
        _jirou.levelStr = @"偏低";
        [mainScroll addSubview:_jirou];
        [_jirou loadContent];
        
        _shuifen = [[BodyCell alloc]initWithFrame:CGRectMake(0, _jirou.frame.origin.y+_jirou.frame.size.height+13, 283, 35)];
        _shuifen.icon = [UIImage imageNamed:@"体成分-水分icon"];
        _shuifen.content = @"水分  1642kcal";
        _shuifen.levelIcon = [UIImage imageNamed:@"体成分-标注icon"];
        _shuifen.levelStr = @"标准";
        [mainScroll addSubview:_shuifen];
        [_shuifen loadContent];
        
        _danbai = [[BodyCell alloc]initWithFrame:CGRectMake(0, _shuifen.frame.origin.y+_shuifen.frame.size.height+13, 283, 35)];
        _danbai.icon = [UIImage imageNamed:@"体成分-蛋白质icon"];
        _danbai.content = @"蛋白质  30.0%";
        _danbai.levelIcon = [UIImage imageNamed:@"体成分-超标icon"];
        _danbai.levelStr = @"肥胖";
        [mainScroll addSubview:_danbai];
        [_danbai loadContent];
        
        _guliang = [[BodyCell alloc]initWithFrame:CGRectMake(0, _danbai.frame.origin.y+_danbai.frame.size.height+13, 283, 35)];
        _guliang.icon = [UIImage imageNamed:@"体成分-骨量icon"];
        _guliang.content = @"骨量  66.3KG";
        _guliang.levelIcon = [UIImage imageNamed:@"体成分-偏低icon"];
        _guliang.levelStr = @"偏低";
        [mainScroll addSubview:_guliang];
        [_guliang loadContent];
        
        _daixie = [[BodyCell alloc]initWithFrame:CGRectMake(0, _guliang.frame.origin.y+_guliang.frame.size.height+13, 283, 35)];
        _daixie.icon = [UIImage imageNamed:@"体成分-基础代谢icon"];
        _daixie.content = @"基础代谢率  66.3kcal/d";
        _daixie.levelIcon = [UIImage imageNamed:@"体成分-偏低icon"];
        _daixie.levelStr = @"偏低";
        [mainScroll addSubview:_daixie];
        [_daixie loadContent];
        
        mainScroll.contentSize = CGSizeMake(self.frame.size.width, 55*6);
    }
    return self;
}

@end
